﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using saigonbook.Biz;

namespace quanlybansach.Frm
{
    public partial class Frm_quanly : Form
    {
        public Frm_quanly(int quyen)
        {
            InitializeComponent();
            NhapHang.Enabled = false;
            QuanLyDonHang.Enabled = false;
            QuanLySach.Enabled = false;
            ThongKeBaoCao.Enabled = false;
            Phanquyen(quyen);
        }

        public void Phanquyen(int quyen)
        {
            if (quyen == 0)
            {
                NhapHang.Enabled = false;
                QuanLyDonHang.Enabled = false;
                QuanLySach.Enabled = false;
                ThongKeBaoCao.Enabled = false;
            }
            if (quyen == 1)
            {
                NhapHang.Enabled = true;
                ThongKeBaoCao.Enabled = true;
            }
            if (quyen == 2)
            {
                NhapHang.Enabled = true;
                QuanLyDonHang.Enabled = true;
                QuanLySach.Enabled = true;
                ThongKeBaoCao.Enabled = true;
            }
        }

        private void tkbc_kinhdoanh_Click(object sender, EventArgs e)
        {
            Frm_thongkebaocao f = new Frm_thongkebaocao();
            f.Show();
        }

        private void thoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void xemphieunhaphang_Click(object sender, EventArgs e)
        {
            Frm_xemphieunhap f = new Frm_xemphieunhap();
            f.Visible = true;
        }

        private void themphieunhap_Click(object sender, EventArgs e)
        {
            Frm_nhaphang f = new Frm_nhaphang();
            f.Visible = true;
        }

        private void QuanLyDonHang_Click(object sender, EventArgs e)
        {
            Frm_quanlydonhang f = new Frm_quanlydonhang();
            f.Visible = true;
        }

        private void thongketonkho_Click(object sender, EventArgs e)
        {
            Frm_thongketonkho f = new Frm_thongketonkho();
            f.Visible = true;
        }

        private void thongkebaocao_img_Click(object sender, EventArgs e)
        {
            Frm_thongkebaocao f = new Frm_thongkebaocao();
            f.Visible = true;
        }

        private void QuanLySach_Click(object sender, EventArgs e)
        {
            Frm_quanlysach f = new Frm_quanlysach();
            f.Show();
        }

        private void quanlyloaisach_Click(object sender, EventArgs e)
        {
            Frm_loaisach f = new Frm_loaisach();
            f.Show();
        }

        private void quanlynhaxuatban_Click(object sender, EventArgs e)
        {
            Frm_nhaxuatban f = new Frm_nhaxuatban();
            f.Show();
        }
    }
}
